<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
// use Illuminate\Http\Request;
// use Closure;

class TrimStrings extends Middleware
{
    /**
     * The names of the attributes that should not be trimmed.
     *
     * @var array<int, string>
     */
    protected $except = [
        'current_password',
        'password',
        'password_confirmation',
    ];

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    // public function handle(Request $request, Closure $next)
    // {
    //     $get = $request->all();
    //     foreach ($get as $key => &$value) {
    //         if (in_array($key, ['sex', 'province', 'city', 'county'])) {
    //             $request->request->set($key, intval($value));
    //         } else {
    //             $request->request->set($key, trim($value));
    //         }
    //     }
    //     return $next($request);
    // }
}
